package Practice;

import java.util.Scanner;

public class PrimeFactorization {
    public static boolean isPrime(int x){
        if (x < 2) return false;
        if (x == 2) return true;
        int x1 = (int) Math.sqrt(x);
        for (int i = 2; i <= x1; i++) {
            if (x%i==0)
                return false;
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = (int)Math.sqrt(n);
        int q;
        for (int i = 2; i <= m; i++) {
            if (n%i == 0){
                q = n/i;
                if (isPrime(i)&&isPrime(q)){
                    System.out.println(q);
                    return;
                }
            }

        }
    }
}
